using System;
using System.Collections.Generic;
using System.Data.Linq;
using Close2Poco;


namespace Close2Poco.Tests.TestEntities
{
    public class Customer: IClose2PocoEntity
    {
        public Customer()
        {
            this.Create(ref _orders);
        }

        EntitySet<Order> _orders;

        [DbType("NChar(5)")]
        public string CustomerID { get; set; }

        [Length(40)]
        public string CompanyName { get; set; }

        [Length(30),
        MapTo("ContactName")]                                // how to map to field with differnt name
        public string Contact{ get; set; }

        [Length(15)]
        public string City { get; set; }
        

        public IList<Order> Orders                                             
        {
            get { return _orders;  }
            set { this.SetValue(ref _orders, value); } 
        }
    }
}